<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>编辑订单退货申请</title>
	<#include "/common/vue_resource.ftl">
</head>
<body>
<div id="app" v-cloak>
	<div class="ui-form">
		<form class="layui-form" @submit.prevent="submitForm()" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">主键<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.id" placeholder="请输入主键" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.orderId" placeholder="请输入订单id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收货地址表id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.companyAddressId" placeholder="请输入收货地址表id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">退货商品id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.productId" placeholder="请输入退货商品id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">订单编号<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.orderSn" placeholder="请输入订单编号" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">会员用户名<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.memberUsername" placeholder="请输入会员用户名" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">退款金额<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.returnAmount" placeholder="请输入退款金额" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">退货人姓名<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.returnName" placeholder="请输入退货人姓名" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">退货人电话<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.returnPhone" placeholder="请输入退货人电话" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">申请状态：0->待处理；1->退货中；2->已完成；3->已拒绝<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.status" placeholder="请输入申请状态：0->待处理；1->退货中；2->已完成；3->已拒绝" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">处理时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.handleTime" placeholder="请输入处理时间" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品图片<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.productPic" placeholder="请输入商品图片" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品名称<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.productName" placeholder="请输入商品名称" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品品牌<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.productBrand" placeholder="请输入商品品牌" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品销售属性：颜色：红色；尺码：xl;<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.productAttr" placeholder="请输入商品销售属性：颜色：红色；尺码：xl;" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">退货数量<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.productCount" placeholder="请输入退货数量" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品单价<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.productPrice" placeholder="请输入商品单价" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">商品实际支付单价<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.productRealPrice" placeholder="请输入商品实际支付单价" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">原因<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.reason" placeholder="请输入原因" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">描述<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.description" placeholder="请输入描述" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">凭证图片，以逗号隔开<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.proofPics" placeholder="请输入凭证图片，以逗号隔开" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">处理备注<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.handleNote" placeholder="请输入处理备注" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">处理人员<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.handleMan" placeholder="请输入处理人员" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收货人<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiveMan" placeholder="请输入收货人" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收货时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiveTime" placeholder="请输入收货时间" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">收货备注<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.receiveNote" placeholder="请输入收货备注" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">是否删除(1是，2否)<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.isDel" placeholder="请输入是否删除(1是，2否)" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">创建人id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.createId" placeholder="请输入创建人id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">创建时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.createTime" placeholder="请输入创建时间" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">修改人id<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.modifyId" placeholder="请输入修改人id" class="layui-input"/>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">修改时间<span class="ui-request">*</span></label>
				<div class="layui-input-block">
					<input type="text" v-model="record.modifyTime" placeholder="请输入修改时间" class="layui-input"/>
				</div>
			</div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="submit" value="保存" class="layui-btn" />
				</div>
			</div>
		</form>
	</div>
</div>
<script>
	var app = new Vue({
		el: '#app',
		data: {
			showTypes: false,
			record : {
				id:'${params.id!}',
				id:'',
				orderId:'',
				companyAddressId:'',
				productId:'',
				orderSn:'',
				memberUsername:'',
				returnAmount:'',
				returnName:'',
				returnPhone:'',
				status:'',
				handleTime:'',
				productPic:'',
				productName:'',
				productBrand:'',
				productAttr:'',
				productCount:'',
				productPrice:'',
				productRealPrice:'',
				reason:'',
				description:'',
				proofPics:'',
				handleNote:'',
				handleMan:'',
				receiveMan:'',
				receiveTime:'',
				receiveNote:'',
				isDel:'',
				createId:'',
				createTime:'',
				modifyId:'',
				modifyTime:'',
			},
		},
		mounted: function () {
			this.init();
			this.loadData();
		},
		methods: {
			init:function(){
				var that = this;
				/*laydate.render({elem: '#beginDate', type:'datetime', done:function (value) {
						that.record.beginDate = value;
					}});*/

			},
			loadData: function () {
				if (!'${params.id!}') {
					return;
				}
				var that = this;
				$.http.post('${params.contextPath}/web/omsOrderReturnApply/query.json', {id: '${params.id!}'}).then(function (data) {
					if (!data.success) {
						$.message(data.message);
						return;
					}
					var item = data.data;
					for (var key in  that.record) {
						that.record[key] = item[key];
					}
				});
			},
			submitForm: function () {
				$.http.post('${params.contextPath}/web/omsOrderReturnApply/<#if (params.id)??>modify<#else>save</#if>.json', this.record).then(function (data) {
					if (!data.success) {
						$.message(data.message);
						return;
					}
					var alt = layer.alert(data.message || "操作成功", function () {
						parent.app.loadData();
						parent.layer.closeAll();
						layer.close(alt);
					});
				});
			},
		}
	});
</script>
</body>

</html>
